package com.igbeok.miscellaneous.hibernate.entity;

import java.sql.Timestamp;
import java.util.Date;

public class TFPaxGrid implements Comparable<TFPaxGrid> {
	private static final int CRITERIA_CURRENT_DAY = 24;

	private Long ifId;
	private Long ofId;
	// Airport code for the flight pair of the operation airport: arr airport
	// for IF, dep airport for OF
	private String tfpAirport;
	// InFlight Number
	private String ifNo;
	// Airport codes of the departure airports for IF
	private String ifDepAirports;
	// InFlight Date, in airport local time, formatted in the standard XML Date
	// format(YYYY-MM-DD)
	// Departure time
	private Date ifStd;
	// InFlight Time of Arrival Type: S/P/E/A/B
	private String ifTaType;
	// InFlight Time of Arrival, in the format of HHMM
	private Date ifTa;
	// STATUS OF THE FLIGHT: DLY,CNL,DVI
	private String ifStatus;
	// InFlight Schedule Time of Arrival
	private Date ifSta;
	// Aircraft Position for IF
	private String ifPos;
	//
	private String ifTailNo;
	// Terminal for IF
	private String ifTerminal;
	// Transfer VIP Count
	private Integer vipCnt;
	// Transfer Passenger Counts by cabin class seperated with /
	private String paxCnt;
	// Transfer Baggage Count
	private Integer bagCnt;
	// (OF_TD - IF_TA) * 24 * 60
	private Integer diffMin;
	// Available time in minutes for transfer
	private Integer availMin;
	// Domestic or International for InFlight and OutFlight
	private String di;
	// Minimum connection time in minutes for transfer
	private Integer mctMin;
	// Minutes used for passenger transfer
	private Integer paxUsedMin;
	// Minutes used for baggage transfer
	private Integer bagUsedMin;
	// Actions selected for pax and baq in the flight pair
	private String actions;
	// Response to the Actions selected for pax and baq in the flight pair
	private String response;
	// ALERT COLOR CODE
	private String alert;
	// ALERT REASON CODE
	private String alertReason;
	// TimeStamp of the last time this row of data got updated,'HH24MISS'
	private Timestamp updTs;
	// Update Flag, N I D U
	private String updFlag;
	// STATUS for the transfer flight pair: PLANED, STARTED, REARRANGED, CLOSED.
	private String tfpStatus;
	// OutFlight Number
	private String ofNo;
	// Airport codes of the arrival airports for OF
	private String ofArrAirports;
	// OutFlight Time of Departure Type: S/P/E/A/B
	private String ofTdType;
	// OutFlight Time of Departure, in format of 'HH24MI DD'
	private Date ofTd;
	private Date ofStd;
	// Airplane Position for OF
	private String ofPos;
	//
	private String ofTailNo;
	// Departure Gate for OF
	private String ofGate;
	//
	private String ofStatus;
	// Terminal for OF
	private String ofTerminal;
	// indicator if flight date is same as(0) or grater than(1+) or less than
	// (-1) today
	private Integer inRelativeDay;
	private Integer outRelativeDay;

	public Integer getInRelativeDay() {
		return inRelativeDay;
	}

	public void setInRelativeDay(Integer inRelativeDay) {
		this.inRelativeDay = inRelativeDay;
	}

	public Integer getOutRelativeDay() {
		return outRelativeDay;
	}

	public void setOutRelativeDay(Integer outRelativeDay) {
		this.outRelativeDay = outRelativeDay;
	}

	public Long getIfId() {
		return ifId;
	}

	public void setIfId(Long ifId) {
		this.ifId = ifId;
	}

	public Long getOfId() {
		return ofId;
	}

	public void setOfId(Long ofId) {
		this.ofId = ofId;
	}

	public String getTfpAirport() {
		return tfpAirport;
	}

	public void setTfpAirport(String tfpAirport) {
		this.tfpAirport = tfpAirport;
	}

	public String getIfNo() {
		return ifNo;
	}

	public void setIfNo(String ifNo) {
		this.ifNo = ifNo;
	}

	public String getIfDepAirports() {
		return ifDepAirports;
	}

	public void setIfDepAirports(String ifDepAirports) {
		this.ifDepAirports = ifDepAirports;
	}

	public String getIfTaType() {
		return ifTaType;
	}

	public void setIfTaType(String ifTaType) {
		this.ifTaType = ifTaType;
	}

	public Date getIfTa() {
		return ifTa;
	}

	public void setIfTa(Date ifTa) {
		this.ifTa = ifTa;
	}

	public Date getIfSta() {
		return ifSta;
	}

	public void setIfSta(Date ifSta) {
		this.ifSta = ifSta;
	}

	public String getIfStatus() {
		return ifStatus;
	}

	public void setIfStatus(String ifStatus) {
		this.ifStatus = ifStatus;
	}

	public String getIfPos() {
		return ifPos;
	}

	public void setIfPos(String ifPos) {
		this.ifPos = ifPos;
	}

	public String getIfTerminal() {
		return ifTerminal;
	}

	public void setIfTerminal(String ifTerminal) {
		this.ifTerminal = ifTerminal;
	}

	public Integer getVipCnt() {
		return vipCnt;
	}

	public void setVipCnt(Integer vipCnt) {
		this.vipCnt = vipCnt;
	}

	public String getPaxCnt() {
		if (paxCnt != null && paxCnt.startsWith("/")) {
			this.paxCnt = "0" + this.paxCnt;
		}
		return paxCnt;
	}

	public void setPaxCnt(String paxCnt) {
		this.paxCnt = paxCnt;
	}

	public Integer getBagCnt() {
		return bagCnt;
	}

	public void setBagCnt(Integer bagCnt) {
		this.bagCnt = bagCnt;
	}

	public Integer getAvailMin() {
		return availMin;
	}

	public void setAvailMin(Integer availMin) {
		this.availMin = availMin;
	}

	public Integer getDiffMin() {
		return diffMin;
	}

	public void setDiffMin(Integer diffMin) {
		this.diffMin = diffMin;
	}

	public String getDi() {
		return di;
	}

	public void setDi(String di) {
		this.di = di;
	}

	public Integer getMctMin() {
		return mctMin;
	}

	public void setMctMin(Integer mctMin) {
		this.mctMin = mctMin;
	}

	public Integer getPaxUsedMin() {
		return paxUsedMin;
	}

	public void setPaxUsedMin(Integer paxUsedMin) {
		this.paxUsedMin = paxUsedMin;
	}

	public Integer getBagUsedMin() {
		return bagUsedMin;
	}

	public void setBagUsedMin(Integer bagUsedMin) {
		this.bagUsedMin = bagUsedMin;
	}

	public String getActions() {
		return actions;
	}

	public void setActions(String actions) {
		this.actions = actions;
	}

	public String getResponse() {
		return response;
	}

	public void setResponse(String response) {
		this.response = response;
	}

	public String getAlert() {
		return alert;
	}

	public void setAlert(String alert) {
		this.alert = alert;
	}

	public String getAlertReason() {
		return alertReason;
	}

	public void setAlertReason(String alertReason) {
		this.alertReason = alertReason;
	}

	public Timestamp getUpdTs() {
		return updTs;
	}

	public void setUpdTs(Timestamp updTs) {
		this.updTs = updTs;
	}

	public String getUpdFlag() {
		return updFlag;
	}

	public void setUpdFlag(String updFlag) {
		this.updFlag = updFlag;
	}

	public String getTfpStatus() {
		return tfpStatus;
	}

	public void setTfpStatus(String tfpStatus) {
		this.tfpStatus = tfpStatus;
	}

	public String getOfNo() {
		return ofNo;
	}

	public void setOfNo(String ofNo) {
		this.ofNo = ofNo;
	}

	public String getOfArrAirports() {
		return ofArrAirports;
	}

	public void setOfArrAirports(String ofArrAirports) {
		this.ofArrAirports = ofArrAirports;
	}

	public String getOfTdType() {
		return ofTdType;
	}

	public void setOfTdType(String ofTdType) {
		this.ofTdType = ofTdType;
	}

	public Date getOfTd() {
		return ofTd;
	}

	public void setOfTd(Date ofTd) {
		this.ofTd = ofTd;
	}

	public String getOfPos() {
		return ofPos;
	}

	public void setOfPos(String ofPos) {
		this.ofPos = ofPos;
	}

	public String getOfGate() {
		return ofGate;
	}

	public void setOfGate(String ofGate) {
		this.ofGate = ofGate;
	}

	public String getOfTerminal() {
		return ofTerminal;
	}

	public void setOfTerminal(String ofTerminal) {
		this.ofTerminal = ofTerminal;
	}

	public Date getIfStd() {
		return ifStd;
	}

	public void setIfStd(Date ifStd) {
		this.ifStd = ifStd;
	}

	public String getIfTailNo() {
		return ifTailNo;
	}

	public void setIfTailNo(String ifTailNo) {
		this.ifTailNo = ifTailNo;
	}

	public String getOfTailNo() {
		return ofTailNo;
	}

	public void setOfTailNo(String ofTailNo) {
		this.ofTailNo = ofTailNo;
	}

	public String getOfStatus() {
		return ofStatus;
	}

	public void setOfStatus(String ofStatus) {
		this.ofStatus = ofStatus;
	}

	public Date getOfStd() {
		return ofStd;
	}

	public void setOfStd(Date ofStd) {
		this.ofStd = ofStd;
	}

	public String status() {
		return this.updFlag;
	}
	
	@Override
	public int compareTo(TFPaxGrid tfPaxGrid) {
		return (this.ifId.intValue() == tfPaxGrid.getIfId().intValue() && this.ofId.intValue() == tfPaxGrid.getOfId()
				.intValue()) ? 0 : 1;
	}
}